package com.j180.dao;

import com.j180.bean.Customer;
import org.apache.ibatis.annotations.*;


import java.util.List;

public interface ICustomerDao {

    @Select("select * from t_customer")
    public List<Customer> getAllCustomers();
    @Select("select * from t_customer where cid=#{id}")
    public Customer getCustomerById(@Param("id") int id);
    @Insert("insert into t_customer values (null,#{cname},#{address})")
    public int  addCustomer(Customer customer);
    @Delete("delete from t_customer where cid=#{id}")
    public int deleteCustomer(@Param("id") int id);
    @Update("update t_customer set cname=#{cname},address=#{address} where cid=#{cid}")
    public int updateCustomer(Customer customer);


}
